﻿Public Class frmAlarmes

    Private Sub frmAlarmes_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        'Remplit le dataSet des controles pour l'alerte
        Partager.remplirRapportControle()
        Dim i As Integer = 0
        Dim numDossier As String = ""
        For Each ligne As DataRow In Partager.ds.Tables(0).Rows
            If numDossier <> CStr(ligne("Num_dossier")) Then
                numDossier = CStr(ligne("Num_dossier"))
                i += 1
            End If
        Next

        If i <> 0 Then
            lstAlarme.Items.Add(i & " جلسة غير مؤخرة")
        End If
    End Sub

    Private Sub lstAlarme_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstAlarme.SelectedIndexChanged
        Try
            lstInfoAlarme.Items.Clear()
            Dim i As Integer = 0
            Dim numDossier As String = ""
            Dim mo9arir As String = ""
            For Each ligne As DataRow In Partager.ds.Tables("Jalassat").Rows
                If numDossier <> CStr(ligne("Num_dossier")) Then
                    numDossier = CStr(ligne("Num_dossier"))
                    If ligne("Mo9arir") Is DBNull.Value Then
                        mo9arir = ""
                    Else
                        mo9arir = ligne("Mo9arir")
                    End If
                    lstInfoAlarme.Items.Add(New ListViewItem(New String() {CStr(Partager.IdsDossiers(i)), ligne("Tribunal"), ligne("Num_Dossier"), mo9arir, ligne("Client"), ligne("Adversaire")}))
                End If
                i += 1
            Next
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

    Private Sub lstInfoAlarme_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstInfoAlarme.DoubleClick
        Partager.idDossier = 0
        If lstInfoAlarme.SelectedIndices.Count > 0 Then
            Partager.idDossier = CInt(lstInfoAlarme.Items(lstInfoAlarme.SelectedIndices(0)).SubItems(0).Text)
            Partager.StandardInitial()
            Partager.verifPriv(Frm_ijra2at)
        End If
    End Sub
End Class